//
//  NinePicsOfCell.m
//  PetAPP
//
//  Created by dllo on 16/1/27.
//  Copyright © 2016年 Yuming. All rights reserved.
//

#import "NinePicsOfCell.h"

@implementation NinePicsOfCell

- (void)setPicViewOfHeightWithModel:(ModelOfContent *)model {
    
    
    CGFloat picViewHeight = 400;
    CGFloat picViewWidth = self.frame.size.width;
    for (int i = 0 ; i < 9; i++) {
        if (i < 3) {
            UIImageView *imageView = [self viewWithTag:(i + 10)];
            imageView.frame = CGRectMake(0 + i * ((picViewWidth - 3) / 3) + i * 3, 0, (picViewWidth - 3) / 3, (picViewHeight - 3) / 3);
//            imageView.yy_imageURL = [NSURL URLWithString:[model.pics[i] objectForKey:@"url"]];
            [imageView yy_setImageWithURL:[NSURL URLWithString:[model.pics[i] objectForKey:@"url"]] options:YYWebImageOptionProgressiveBlur | YYWebImageOptionSetImageWithFadeAnimation];

            
        }else if (i < 6){
            UIImageView *imageView = [self viewWithTag:(i + 10)];
            imageView.frame = CGRectMake(0 + (i - 3) * ((picViewWidth - 3) / 3) + (i - 3) * 3, (picViewHeight - 3) / 3 + 3, (picViewWidth - 3) / 3, (picViewHeight - 3) / 3);
//            imageView.yy_imageURL = [NSURL URLWithString:[model.pics[i] objectForKey:@"url"]];
            [imageView yy_setImageWithURL:[NSURL URLWithString:[model.pics[i] objectForKey:@"url"]] options:YYWebImageOptionProgressiveBlur | YYWebImageOptionSetImageWithFadeAnimation];

            
        }else {
            
            UIImageView *imageView = [self viewWithTag:(i + 10)];
            imageView.frame = CGRectMake(0 + (i - 6) * ((picViewWidth - 3) / 3) + (i - 6) * 3, ((picViewHeight - 3) / 3) * 2 + 6, (picViewWidth - 3) / 3, (picViewHeight - 3) / 3);
//            imageView.yy_imageURL = [NSURL URLWithString:[model.pics[i] objectForKey:@"url"]];
            [imageView yy_setImageWithURL:[NSURL URLWithString:[model.pics[i] objectForKey:@"url"]] options:YYWebImageOptionProgressiveBlur | YYWebImageOptionSetImageWithFadeAnimation];

        
        }
        
    }
    
    self.viewOfpics.frame = CGRectMake(0, self.beginHeight, self.frame.size.width, picViewHeight);
    

    
}


@end
